<?php /* Smarty version Smarty-3.1.13, created on 2014-05-13 22:50:20
         compiled from "E:\phpweb\YiVa\templates\admin\seo\seo.tpl" */ ?>
<?php /*%%SmartyHeaderCode:259085372312c895297-39335756%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
$_valid = $_smarty_tpl->decodeProperties(array (
  'file_dependency' => 
  array (
    '859aaae8b130163979858eb9c48835b52d70c21c' => 
    array (
      0 => 'E:\\phpweb\\YiVa\\templates\\admin\\seo\\seo.tpl',
      1 => 1389016409,
      2 => 'file',
    ),
  ),
  'nocache_hash' => '259085372312c895297-39335756',
  'function' => 
  array (
  ),
  'variables' => 
  array (
    'params' => 0,
  ),
  'has_nocache_code' => false,
  'version' => 'Smarty-3.1.13',
  'unifunc' => 'content_5372312c901c10_31459023',
),false); /*/%%SmartyHeaderCode%%*/?>
<?php if ($_valid && !is_callable('content_5372312c901c10_31459023')) {function content_5372312c901c10_31459023($_smarty_tpl) {?><?php echo $_smarty_tpl->getSubTemplate ("admin/header.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, null, null, array(), 0);?>

<?php echo $_smarty_tpl->getSubTemplate ("admin/navibar.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, null, null, array(), 0);?>

<?php echo $_smarty_tpl->getSubTemplate ("admin/sidebar.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, null, null, array(), 0);?>


<div class="content">

    <!-- 表格头部开始 -->
    <div class="header">
        <div class="stats"><p class="stat"></p>
        </div>
        <h1 class="page-title">网站 SEO 设置</h1>
    </div>
    <!-- 表格头部结束 -->

	<div class="container-fluid">
		<div class="row-fluid">

            <div class="alert  alert-info fade in">
                <button type="button" class="close" data-dismiss="alert">×</button>
                <strong>变量提示!</strong>
                <p>网站名称:{website_name}首页标题:{home_title}，首页关键字:{home_keywords}，首页描述:{home_desc} </p>
                <p> 文章标题:{post_title}，文章摘要:{post_excerpt}，文章标签:{post_tags} </p>
                <p>当前分类:{category} 当前标签:{tag} 当前搜索关键字 {search} </p>

            </div>

            <ul class="nav nav-tabs" id="myTab">
                <li class="active">
                    <a href="#home" data-toggle="tab">首页SEO</a>
                </li>
                <li><a href="#categoryseo" data-toggle="tab">分类页SEO</a></li>
                <li><a href="#postseo" data-toggle="tab">文章页SEO</a></li>
                <li><a href="#tagseo" data-toggle="tab">标签页SEO</a></li>
            </ul>
            <div id="myTabContent" class="tab-content">
                <div class="tab-pane fade active in" id="home">
                    <p>
                    <form class="form-horizontal">
                        <div class="control-group">
                            <label class="control-label" for="indextitle">标题</label>
                            <div class="controls">
                                <input type="text" value="<?php echo $_smarty_tpl->tpl_vars['params']->value['home_title'];?>
" id="home_title" placeholder="首页标题" class="input-xxlarge">
                            </div>
                        </div>
                        <div class="control-group">
                            <label class="control-label" for="indexkeyword">关键字</label>
                            <div class="controls">
                                <input type="text"  value="<?php echo $_smarty_tpl->tpl_vars['params']->value['home_keywords'];?>
"  id="home_keywords" placeholder="首页关键字" class="input-xxlarge">
                            </div>
                        </div>
                        <div class="control-group">
                            <label class="control-label" for="indexkeyword">描述</label>
                            <div class="controls">
                                <textarea rows="10" style="width:450px" id="home_desc"><?php echo $_smarty_tpl->tpl_vars['params']->value['home_desc'];?>
</textarea>
                            </div>
                        </div>
                        <div class="control-group">
                            <div class="controls">
                                <button type="button" class="btn btn-primary" onclick="updateSeo(0);">更新</button>
                            </div>
                        </div>
                    </form>
                    </p>
                </div>
                <div class="tab-pane fade" id="categoryseo">
                    <p>
                    <form class="form-horizontal">
                        <div class="control-group">
                            <label class="control-label" for="indextitle">标题</label>
                            <div class="controls">
                                <input type="text" id="category_title" value="<?php echo $_smarty_tpl->tpl_vars['params']->value['category_title'];?>
" placeholder="分类页标题" class="input-xxlarge">
                            </div>
                        </div>
                        <div class="control-group">
                            <label class="control-label" for="indexkeyword">关键字</label>
                            <div class="controls">
                                <input type="text" value="<?php echo $_smarty_tpl->tpl_vars['params']->value['category_keywords'];?>
" id="category_keywords" placeholder="分类页关键字" class="input-xxlarge">
                            </div>
                        </div>
                        <div class="control-group">
                            <label class="control-label" for="indexkeyword">描述</label>
                            <div class="controls">
                                <textarea rows="10" style="width:450px" id="category_desc"><?php echo $_smarty_tpl->tpl_vars['params']->value['category_desc'];?>
</textarea>
                            </div>
                        </div>
                        <div class="control-group">
                            <div class="controls">
                                <button type="button" class="btn btn-primary" onclick="updateSeo(1);">更新</button>
                            </div>
                        </div>
                    </form>
                    </p>
                </div>
                <div class="tab-pane fade" id="postseo">
                    <p>
                    <form class="form-horizontal">
                        <div class="control-group">
                            <label class="control-label" for="indextitle">标题</label>
                            <div class="controls">
                                <input type="text" id="post_title" value="<?php echo $_smarty_tpl->tpl_vars['params']->value['post_title'];?>
" placeholder="文章页标题" class="input-xxlarge">
                            </div>
                        </div>
                        <div class="control-group">
                            <label class="control-label" for="indexkeyword">关键字</label>
                            <div class="controls">
                                <input type="text" value="<?php echo $_smarty_tpl->tpl_vars['params']->value['post_keywords'];?>
"  id="post_keywords" placeholder="文章页关键字" class="input-xxlarge">
                            </div>
                        </div>
                        <div class="control-group">
                            <label class="control-label" for="indexkeyword">描述</label>
                            <div class="controls">
                                <textarea rows="10" style="width:450px" id="post_desc"><?php echo $_smarty_tpl->tpl_vars['params']->value['post_desc'];?>
</textarea>
                            </div>
                        </div>
                        <div class="control-group">
                            <div class="controls">
                                <button type="button" class="btn btn-primary" onclick="updateSeo(2);">更新</button>
                            </div>
                        </div>
                    </form>
                    </p>
                </div>
                <div class="tab-pane fade" id="tagseo">
                    <p>
                    <form class="form-horizontal">
                        <div class="control-group">
                            <label class="control-label" for="indextitle">标题</label>
                            <div class="controls">
                                <input type="text" id="tag_title" value="<?php echo $_smarty_tpl->tpl_vars['params']->value['tag_title'];?>
" placeholder="TAG页标题" class="input-xxlarge">
                            </div>
                        </div>
                        <div class="control-group">
                            <label class="control-label" for="indexkeyword">关键字</label>
                            <div class="controls">
                                <input type="text" id="tag_keywords" value="<?php echo $_smarty_tpl->tpl_vars['params']->value['tag_keywords'];?>
"  placeholder="TAG页关键字" class="input-xxlarge">
                            </div>
                        </div>
                        <div class="control-group">
                            <label class="control-label" for="indexkeyword">描述</label>
                            <div class="controls">
                                <textarea rows="10" style="width:450px" id="tag_desc"><?php echo $_smarty_tpl->tpl_vars['params']->value['tag_desc'];?>
</textarea>
                            </div>
                        </div>
                        <div class="control-group">
                            <div class="controls">
                                <button type="button" class="btn btn-primary" onclick="updateSeo(3);">更新</button>
                            </div>
                        </div>
                    </form>
                    </p>
                </div>
            </div>

        </div>
	</div>
</div>

<script src="<?php echo @constant('WEBSITE_URL');?>
public/assets/layer/layer.min.js"></script>
<script type="text/javascript">
    $(document).ready(function(){
        $("[href^='#']").click(function (){location.hash=$(this).attr("href"); return false;});
        $('#myTab a').click(function (e) {
            e.preventDefault();
            $(this).tab('show');
        })
    });
 function updateSeo(formtype){
     var obj={};
     //index
     if(formtype == 0){
         obj.formtype=0;
         obj.title = $("#home_title").val();
         obj.keywords = $("#home_keywords").val();
         obj.desc = $("#home_desc").val();
      //category
     }else if(formtype == 1){
         obj.formtype=1;
         obj.title = $("#category_title").val();
         obj.keywords = $("#category_keywords").val();
         obj.desc = $("#category_desc").val();
     }//post
    else if(formtype == 2){
         obj.formtype=2;
         obj.title = $("#post_title").val();
         obj.keywords = $("#post_keywords").val();
         obj.desc = $("#post_desc").val();
    }//tag
    else if(formtype == 3){
         obj.formtype=3;
         obj.title = $("#tag_title").val();
         obj.keywords = $("#tag_keywords").val();
         obj.desc = $("#tag_desc").val();
     }
        $.post('admin/seo/update', obj,
             function( data ) {
                 if(data.success){
                         $.layer({
                             area : ['auto','auto'],
                             dialog : {msg:'设置成功',type : 1}
                         });
                 }else{
                     $.layer({
                         area : ['auto','auto'],
                         dialog : {msg:'设置失败',type : 1}
                     });
                 }
             },  "json");
 }
</script>
<?php echo $_smarty_tpl->getSubTemplate ("admin/footer.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, null, null, array(), 0);?>


<?php }} ?>